%module nav
%{
#include "ChunkyTriMesh.h"
#include "DetourAlloc.h"
#include "DetourAssert.h"
#include "DetourCommon.h"
#include "DetourCrowd.h"
#include "DetourLocalBoundary.h"
#include "DetourMath.h"
#include "DetourNavMesh.h"
#include "DetourNavMeshBuilder.h"
#include "DetourNavMeshQuery.h"
#include "DetourNode.h"
#include "DetourObstacleAvoidance.h"
#include "DetourPathCorridor.h"
#include "DetourPathQueue.h"
#include "DetourProximityGrid.h"
#include "DetourStatus.h"
#include "DetourTileCache.h"
#include "DetourTileCacheBuilder.h"
#include "InputGeom.h"
#include "MeshLoaderObj.h"
#include "Recast.h"
#include "RecastAlloc.h"
#include "RecastAssert.h"
#include "TileCacheMemory.h"
#include "loader.h"
%}


%define OUTPUTDOUBLEPTR_TYPEMAP(TYPE,VARNAME)
%typemap(gotype) TYPE ** VARNAME %{*uintptr%}
%typemap(imtype) TYPE ** VARNAME %{uintptr%}
%typemap(goin) TYPE ** VARNAME %{
    $result= uintptr(unsafe.Pointer($input))
%}

%enddef

OUTPUTDOUBLEPTR_TYPEMAP(dtMeshTile,tile)
OUTPUTDOUBLEPTR_TYPEMAP(dtMeshTile,tiles)
OUTPUTDOUBLEPTR_TYPEMAP(dtCrowdAgent,agents)
OUTPUTDOUBLEPTR_TYPEMAP(dtPoly,poly)
OUTPUTDOUBLEPTR_TYPEMAP(dtPoly,polys)

%ignore dtNavMesh::getTileAndPolyByRefUnsafe(const dtPolyRef ref, const dtMeshTile** tile, const dtPoly** poly) const;
%ignore dtTileCache::update(const float dt, class dtNavMesh* navmesh);
%ignore	dtNavMeshQuery::raycast(dtPolyRef startRef, const float* startPos, const float* endPos,const dtQueryFilter* filter, float* t, float* hitNormal, dtPolyRef* path, int* pathCount, const int maxPath) const;
%ignore dtNavMeshQuery::findStraightPath(const float* startPos, const float* endPos,const dtPolyRef* path, const int pathSize,  float* straightPath, unsigned char* straightPathFlags, dtPolyRef* straightPathRefs,  int* straightPathCount, const int maxStraightPath) const;
%ignore dtNavMeshQuery::initSlicedFindPath(dtPolyRef startRef, dtPolyRef endRef,const float* startPos, const float* endPos,const dtQueryFilter* filter);
%ignore dtNavMeshQuery::findNearestPoly(const float* center, const float* halfExtents,const dtQueryFilter* filter,dtPolyRef* nearestRef, float* nearestPt) const;
%ignore	dtNavMeshQuery::raycast(dtPolyRef startRef, const float* startPos, const float* endPos, const dtQueryFilter* filter, float* t, float* hitNormal, dtPolyRef* path, int* pathCount, const int maxPath) const;
%ignore	dtNavMeshQuery::raycast(dtPolyRef startRef, const float* startPos, const float* endPos, const dtQueryFilter* filter, const unsigned int options, dtRaycastHit* hit, dtPolyRef prevRef = 0) const;
%ignore	dtNavMeshQuery::queryPolygons(const float* center, const float* halfExtents, const dtQueryFilter* filter, dtPolyRef* polys, int* polyCount, const int maxPolys) const;
%ignore	dtTileCache::addBoxObstacle(const float* bmin, const float* bmax, dtObstacleRef* result);
%rename(initWithParams) dtNavMesh::init(const dtNavMeshParams* params);
%ignore dtCrowdAgent::corridor;
%ignore dtCrowdAgent::boundary;

%include "include/recastnavigation/DetourAlloc.h"
%include "include/recastnavigation/DetourAssert.h"
%include "include/recastnavigation/DetourCommon.h"
%include "include/recastnavigation/DetourCrowd.h"
%include "include/recastnavigation/DetourLocalBoundary.h"
%include "include/recastnavigation/DetourMath.h"
%include "include/recastnavigation/DetourNavMesh.h"
%include "include/recastnavigation/DetourNavMeshBuilder.h"
%include "include/recastnavigation/DetourNavMeshQuery.h"
%include "include/recastnavigation/DetourNode.h"
%include "include/recastnavigation/DetourObstacleAvoidance.h"
%include "include/recastnavigation/DetourPathCorridor.h"
%include "include/recastnavigation/DetourPathQueue.h"
%include "include/recastnavigation/DetourProximityGrid.h"
%include "include/recastnavigation/DetourStatus.h"
%include "include/recastnavigation/DetourTileCache.h"
%include "include/recastnavigation/DetourTileCacheBuilder.h"
%include "include/recastnavigation/Recast.h"
%include "include/recastnavigation/RecastAlloc.h"
%include "include/recastnavigation/RecastAssert.h"

%include "include/loader/ChunkyTriMesh.h"
%include "include/loader/InputGeom.h"
%include "include/loader/MeshLoaderObj.h"
%include "include/loader/TileCacheMemory.h"
%include "include/loader/loader.h"


